CC = arm-apple-darwin-cc
LD = $(CC)
LDFLAGS = -ObjC -fobjc-exceptions -framework CoreFoundation -framework Foundation \
          -framework UIKit -framework LayerKit -framework Coregraphics \
          -framework GraphicsServices -framework Celestial

CFLAGS = -Wall -Werror

all:	iPong

iPong: main.o MobilePong.o PongGameView.o PongField.o PongFieldController.o AbstractSocket.o \
       Socket.o MutableDataBufferExtension.o BufferedSocket.o ClientController.o PongGeometry.o\
       ServerController.o PongAudio.o PongMainView.o PongPrefs.o PongPrefsView.o

	$(LD) $(LDFLAGS) -o $@ $^

%.o:	%.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

package: iPong
	rm -fr iPong.app
	mkdir -p iPong.app
	cp iPong iPong.app/iPong
	cp Info.plist iPong.app/Info.plist
	cp icon.png iPong.app/icon.png
	cp Default.png iPong.app/Default.png
	cp PongLose.wav iPong.app/PongLose.wav
	cp PongBounce.wav iPong.app/PongBounce.wav

clean:	
	rm -fr *.o iPong iPong.app
